//导入定一仓库的方法
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
//定义仓库
//把你定义好的仓库倒出去
export const listStore = defineStore('list', () => {
  //准备一个空数组
  const list = ref<string[]>([])
  //准备一个计算属性
  const length = computed(() => list.value.length * 10)
  //准备一个方法
  const pushApi = (str: string ) => {
    list.value.push(str)
  }

  //
  return { list, pushApi, length }
})
